 /*
{
"状态":1,
"名称":"获取-店铺权限列表",
"作者":"马学兵",
"创建时间":"2018-12-30",
"功能":"获取-店铺权限列表",
"log": [
	{"date":"06-01" , "dev" :"hzhh" , "content" : ""}
]
}
*/
--前端调用
DECLARE @user_id varchar(100)  
 

set @user_id=dbo.ft_checkparavalue('{user_id}','user_id','')


IF @user_id=''
BEGIN
	 SELECT * FROM dbo.y_dict  WHERE dict_key=108
END
ELSE
begin
	set @user_id=@user_id+'%'
	
	SELECT * FROM dbo.y_dict  WHERE dict_key=108  AND 
	CASE  dict_id 
	WHEN '10801' THEN 'all'
	WHEN '10802' THEN 'entity_code '
	WHEN '10803' THEN 'entityName'
	WHEN '10804' THEN 'short_name'
	WHEN '10805' THEN 'entity_type'
	WHEN '10806' THEN 'company'
	WHEN '10807' THEN 'area' 
	WHEN '10808' THEN 'group'
	WHEN '10809' THEN 'province'
	WHEN '10810' THEN 'city'
	WHEN '10811' THEN 'county'
	WHEN '10812' THEN 'supervisor' else '' END   IN (   SELECT attribute FROM b_entity_right WHERE user_key in(select user_key from y_user where user_id like @user_id  or user_name like @user_id ))  
	ORDER BY dict_id
END 
